home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / c_attr.zip / CATTR.PAS < prev   
Pascal/Delphi Source File  |  1993-04-01  |  2KB  |  86 lines

  1.  
  2.    {$A+,B-,D-,E-,F-,I+,N-,O-,R-,S-,V+}
  3.    {$M 1024, 0, 0}
  4.  
  5. program DisplayAttrChart;
  6. uses
  7.   TpCrt;
  8.  
  9. const
  10.                    (* ReadKeyWord constant.                                 *)
  11.   coEscapeKey       = $011B;
  12.  
  13.   BlinkOn : boolean = true;
  14.   CGAmode : boolean = false;
  15.  
  16.  
  17.                    (* Note 'ATTRCHRT.OBJ' created using BIN2OBJ program.    *)
  18.   {$F+}
  19.   procedure AttrChartData; external;
  20.   {$L ATTRCHRT.OBJ}
  21.   {$F-}
  22.  
  23.  
  24. const
  25.                    (* Packed-window pointer set to address of AttrChartData *)
  26.     AttrScreen : PackedWindowPtr = addr(AttrChartData);
  27.  
  28. var
  29.   woCmd : word;
  30.  
  31.  
  32.                    (* Clear the keyboard-buffer.                            *)
  33.   procedure ClearKeyBuff; assembler;
  34.   asm
  35.     @1: mov ah, 1
  36.         int 16h
  37.         jz  @2
  38.         mov ah, 0
  39.         int 16h
  40.         jmp @1
  41.     @2:
  42.   end;             (* ClearKeyBuff                                          *)
  43.  
  44.  
  45.                    (* Set the CGA blink attribute.                          *)
  46.   procedure SetBlinkCGA(On : boolean);
  47.   begin
  48.     if On then
  49.       port[$3D8] := $29
  50.     else
  51.       port[$3D8] := $09
  52.   end;             (* SetBlinkCGA                                           *)
  53.  
  54.  
  55.                    (* Set the EGA+ blink attribute.                         *)
  56.   procedure SetBlinkEGA(On : boolean); assembler;
  57.   asm
  58.     mov bl,On
  59.     mov ax,$1003
  60.     int $10
  61.   end;             (* SetBlinkEGA                                           *)
  62.  
  63.  
  64.                    (* Main program block.                                   *)
  65. BEGIN
  66.   HiddenCursor;
  67.   DispPackedWindow(AttrScreen);
  68.   repeat
  69.     ClearKeyBuff;
  70.     woCmd := ReadKeyWord;
  71.     BlinkOn := NOT BlinkOn;
  72.     if BlinkOn then
  73.       fastwrite('  BLINK-BIT ON  ', 24, 33, $1F)
  74.     else
  75.       fastwrite('  BLINK-BIT OFF ', 24, 33, $1F);
  76.     if (CurrentDisplay = CGA) then
  77.       SetBlinkCGA(BlinkOn)
  78.     else
  79.       SetBlinkEGA(BlinkOn)
  80.   until (woCmd = coEscapeKey);
  81.   SetBlink(true);
  82.   NormalCursor;
  83.   clrscr
  84. END.
  85.  
  86.